package com.atguigu;

import jakarta.annotation.PostConstruct;
import jakarta.annotation.Resource;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

@SpringBootApplication
public class DefineJucApplication {

    @Resource
    private ThreadPoolTaskExecutor threadPool;

    public static void main(String[] args) {
        SpringApplication.run(DefineJucApplication.class, args);
    }

    @PostConstruct
    public void getThreadPoolConfig() {
        System.out.println("*******threadPool getCorePoolSize: " + threadPool.getCorePoolSize());
        System.out.println("*******threadPool getMaxPoolSize: " + threadPool.getMaxPoolSize());
        System.out.println("*******threadPool getQueueCapacity: " + threadPool.getQueueCapacity());
        System.out.println("*******threadPool getKeepAliveSeconds: " + threadPool.getKeepAliveSeconds());
        System.out.println("*******threadPool availableProcessors: " + Runtime.getRuntime().availableProcessors());
    }
}
